Repository navigation
bugfix: Fix flaky dumpWithoutCrash instrumentation test on CI - #229
Merged
Merged
Conversation
Contributor
|
Thanks for the changes! Could we reuse
|
Collaborator
Author
|
@KishanPRao thanks for your review! I've changed my code and now it's using |
Contributor
|
The PR description needs to be updated with the latest changes. |
KishanPRao
approved these changes
Nov 26, 2026
melekr
approved these changes
Nov 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
dumpWithoutCrashfailed intermittently on CI. It slept for a fixed time after tapping the button, queried Coroner once forCrashreports in that time window, and required exactly one result. On CI, native dump ingestion often takes longer than that sleep. OtherCrashreports in the same window, from other tests or other devices in the same run, could also make the exact-count check fail or let the wrong report pass.Changes
dumpWithoutCrashno longer sleeps and queries once. It now calls the existingCoronerNativeReportAssertions.awaitExactlyOneWithMessage. That helper polls Coroner for up to 90 s for reports that have this run'sguidanderror.message == "DumpWithoutCrash", and requires the report to be aCrash. It then waits 10 s and checks again, so a duplicate that arrives late fails the test.MainActivityaccepts a newEXTRA_REPORT_GUIDintent extra. When it is set, the value goes into theguidattribute before Backtrace and its native integration start. Without the extra, the example app works as before.ExampleInstrumentedTestmakes one random GUID per instrumentation process and passes it through the activity rule. It is shared across tests, not per test, because Crashpad initializes once per process and ignores later re-initialization. Only the GUID from the firstMainActivitylaunch reaches native reports. The message and timestamp filters keep tests apart.Assert.assertEqualsto the statically importedassertEqualsin the other tests in this file.This addresses the review feedback: other
Crashreports in the window, dumps from other devices, and duplicate dumps are now all rejected.Only the example app changes (
ExampleInstrumentedTest.java,MainActivity.java), there are no library code changes.